<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pin: Physical context manipulation API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Pin
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Physical context manipulation API<div class="ingroups"><a class="el" href="group__API__REF.html">Instrumentation API Reference</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga3c6833a027db42b5d528a0c65cefbc07"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__PHYSICAL__CONTEXT.html#ga3c6833a027db42b5d528a0c65cefbc07">PHYSICAL_CONTEXT</a></td></tr>
<tr class="separator:ga3c6833a027db42b5d528a0c65cefbc07"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga1f2a4f0f1fda834df1d117270ee6b3b9"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__PHYSICAL__CONTEXT.html#ga1f2a4f0f1fda834df1d117270ee6b3b9">PIN_SetPhysicalContextReg</a> (<a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *pPhysCtxt, <a class="el" href="group__REG.html#ga8f899d7ad1af070aae505a85cc998fa5">REG</a> reg, ADDRINT val)</td></tr>
<tr class="separator:ga1f2a4f0f1fda834df1d117270ee6b3b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3a006fe2cf24804b69d56aca517b74ec"><td class="memItemLeft" align="right" valign="top">ADDRINT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__PHYSICAL__CONTEXT.html#ga3a006fe2cf24804b69d56aca517b74ec">PIN_GetPhysicalContextReg</a> (const <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *pPhysCtxt, <a class="el" href="group__REG.html#ga8f899d7ad1af070aae505a85cc998fa5">REG</a> reg)</td></tr>
<tr class="separator:ga3a006fe2cf24804b69d56aca517b74ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9aa8122d887712974421753744f362b6"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__PHYSICAL__CONTEXT.html#ga9aa8122d887712974421753744f362b6">PIN_SetPhysicalContextFPState</a> (<a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *pPhysCtxt, const VOID *fpstate)</td></tr>
<tr class="separator:ga9aa8122d887712974421753744f362b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0150c6455fbab3a54a27dd00e6a39d33"><td class="memItemLeft" align="right" valign="top">VOID&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__PHYSICAL__CONTEXT.html#ga0150c6455fbab3a54a27dd00e6a39d33">PIN_GetPhysicalContextFPState</a> (const <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *pPhysCtxt, VOID *fpstate)</td></tr>
<tr class="separator:ga0150c6455fbab3a54a27dd00e6a39d33"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This API allows the user to read and modify the Pin/tool architectural register state of the processor. The registers physical context range (enumerated in REG) is up to REG_PHYSICAL_CONTEXT_END registers and floating point state.</p>
<p>The tool receives physical context in the <a class="el" href="group__PIN__CONTROL.html#ga48e4c80589225d40efe177a9d399225c">INTERNAL_EXCEPTION_CALLBACK</a>. At this time, the tool can read and modify individual physical register values and modify floating point state using the <a class="el" href="group__PHYSICAL__CONTEXT.html#ga3a006fe2cf24804b69d56aca517b74ec">PIN_GetPhysicalContextReg()</a>, <a class="el" href="group__PHYSICAL__CONTEXT.html#ga1f2a4f0f1fda834df1d117270ee6b3b9">PIN_SetPhysicalContextReg()</a>, <a class="el" href="group__PHYSICAL__CONTEXT.html#ga9aa8122d887712974421753744f362b6">PIN_SetPhysicalContextFPState()</a>, <a class="el" href="group__PHYSICAL__CONTEXT.html#ga0150c6455fbab3a54a27dd00e6a39d33">PIN_GetPhysicalContextFPState()</a>. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga3c6833a027db42b5d528a0c65cefbc07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3c6833a027db42b5d528a0c65cefbc07">&#9670;&nbsp;</a></span>PHYSICAL_CONTEXT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Physical state of the processor.<br  />
The tool should not read or modify data members of this structure directly, but must treat the structure as logically opaque and use the <a class="el" href="group__PHYSICAL__CONTEXT.html">Physical context manipulation API</a> functions to manage it. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga0150c6455fbab3a54a27dd00e6a39d33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0150c6455fbab3a54a27dd00e6a39d33">&#9670;&nbsp;</a></span>PIN_GetPhysicalContextFPState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_GetPhysicalContextFPState </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *&#160;</td>
          <td class="paramname"><em>pPhysCtxt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VOID *&#160;</td>
          <td class="paramname"><em>fpstate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the floating point state of the specified physical context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pPhysCtxt</td><td>physical context whose floating point state is retrieved </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fpstate</td><td>pointer to the buffer that receives floating point state of the context. The size of the buffer must be at least FPSTATE_SIZE bytes. The returned state has fxsave format in IA-32 and Intel(R) 64 architectures.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Windows<br  />
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br  />
</dd></dl>

</div>
</div>
<a id="ga3a006fe2cf24804b69d56aca517b74ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3a006fe2cf24804b69d56aca517b74ec">&#9670;&nbsp;</a></span>PIN_GetPhysicalContextReg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ADDRINT PIN_GetPhysicalContextReg </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *&#160;</td>
          <td class="paramname"><em>pPhysCtxt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__REG.html#ga8f899d7ad1af070aae505a85cc998fa5">REG</a>&#160;</td>
          <td class="paramname"><em>reg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the value of the integer register in the specified physical context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">pPhysCtxt</td><td>physical context whose register value is requested </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">reg</td><td>physical register whose value is requested (up to REG_PHYSICAL_INTEGER_END) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>value of the register in the specified context</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Windows<br  />
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br  />
</dd></dl>

</div>
</div>
<a id="ga9aa8122d887712974421753744f362b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9aa8122d887712974421753744f362b6">&#9670;&nbsp;</a></span>PIN_SetPhysicalContextFPState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_SetPhysicalContextFPState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *&#160;</td>
          <td class="paramname"><em>pPhysCtxt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VOID *&#160;</td>
          <td class="paramname"><em>fpstate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the given floating point state in the specified physical context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">pPhysCtxt</td><td>physical context whose floating point state is to be set </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">fpstate</td><td>new floating point state of the context. It must have fxsave format in IA-32 and Intel(R) 64 architectures. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Windows<br  />
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br  />
</dd></dl>

</div>
</div>
<a id="ga1f2a4f0f1fda834df1d117270ee6b3b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f2a4f0f1fda834df1d117270ee6b3b9">&#9670;&nbsp;</a></span>PIN_SetPhysicalContextReg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VOID PIN_SetPhysicalContextReg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structPHYSICAL__CONTEXT.html">PHYSICAL_CONTEXT</a> *&#160;</td>
          <td class="paramname"><em>pPhysCtxt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__REG.html#ga8f899d7ad1af070aae505a85cc998fa5">REG</a>&#160;</td>
          <td class="paramname"><em>reg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ADDRINT&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the given value for the integer register in the specified physical context.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">pPhysCtxt</td><td>physical context whose register value is to be set </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">reg</td><td>physical register whose value is to be set (up to REG_PHYSICAL_INTEGER_END) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>new value of the register</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Availability:</dt><dd><b>Mode:</b> JIT<br  />
<b>O/S</b>: Windows<br  />
<b>CPU:</b> IA-32 and Intel(R) 64 architectures<br  />
</dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
